function [price sig]=ceshi(s0,strike,sigma,r,t,nrstep,nrpath)
rx=randn(nrpath,nrstep-1);
deltaT=t/(nrstep-1);
S=[s0*ones(nrpath,1) zeros(nrpath,nrstep-1)];
for i=1:(nrstep-1)
    S(:,i+1)=S(:,i)+S(:,i)*r*deltaT+sigma*deltaT^0.5*(S(:,i).*rx(:,i));
end
pl=max(strike-mean(min(S(:,1:end),strike)),0);
price=exp(-r*t)*mean(pl);
sig=std(pl)/nrpath^0.5;
end
